# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=moccasin
pkgver=0.1.3
pkgrel=0
pkgdesc="TUI feed reader with Vim keybindings"
url="https://github.com/rektdeckard/moccasin"
# x86: cannot find function "_mm_extract_epi64" in this scope
arch="all !x86"
license="MIT"
depends="cmd:tput"
makedepends="
	cargo
	cargo-auditable
	openssl-dev
	"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://static.crates.io/crates/moccasin/moccasin-$pkgver.crate"

# use system openssl
export OPENSSL_NO_VENDOR=1

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release
}

check() {
	cargo test --frozen
}

package() {
	install -Dvm755 target/release/mcsn -t "$pkgdir"/usr/bin/

	install -Dvm644 README.md -t "$pkgdir"/usr/share/doc/$pkgname/
	install -Dvm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}

sha512sums="
39a85eb19ce8eced87e54e84637e320e6287f8b11df34c4781bfb17e928ff4b9bb87fd4728d268b785ce4e313d851845b38de022af4914d4897970a0069bc0fd  moccasin-0.1.3.tar.gz
"
